package com.gitee.dupe.dict.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gitee.dolt.core.base.entity.Entity;
import com.gitee.dolt.core.validator.SimpleCharacter;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;

/**
 * <p>
 * 实体类
 * 参数配置
 * </p>
 *
 * @author LYH
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("b_parameter")
@ApiModel(value = "Parameter", description = "参数配置")
public class Parameter extends Entity<Long> {

    private static final long serialVersionUID = 1L;

    /**
     * 参数键
     */
    @ApiModelProperty(value = "参数键", required = true)
    @NotEmpty
    @Length(max = 255)
    @TableField(value = "key_", condition = LIKE)
    @SimpleCharacter
    private String key;

    /**
     * 参数值
     */
    @ApiModelProperty(value = "参数值")
    @NotEmpty
    @Length(max = 255)
    @TableField(value = "value", condition = LIKE)
    private String value;

    /**
     * 参数名称
     */
    @ApiModelProperty(value = "参数名称", required = true)
    @NotEmpty
    @Length(max = 255)
    private String name;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255)
    @TableField(value = "remark")
    private String remark;

    /**
     * 是否启用
     */
    @ApiModelProperty(value = "是否启用")
    @TableField("enabled")
    @NotNull
    private Boolean enabled;

    /**
     * 内置
     */
    @ApiModelProperty(value = "是否内置")
    @TableField("readonly_")
    private Boolean readonly;


}
